<?if(!defined("PROLOG_INCLUDED") || PROLOG_INCLUDED!==true)die();?>
<?//d($arResult)?>
<?if(!empty($arResult["ITEMS"]) AND !empty($arParams["SHOW_FIELDS"])):?>
<?
	$arDecorate = Array(
		"NAME" => '<a href="/admin/catalog/elements.php?TYPE=#CATALOG_TYPE_ID#&CATALOG_ID=#CATALOG_ID#&ID=#ID#&ACTION=EDIT">#NAME#</a>',
	);
?>
		<?foreach ($arResult["ITEMS"] as $n => $arItem):?>
			<tr <?=$n%2 ? 'class="altrow"' : ''?>>
				<?foreach ($arParams["SHOW_FIELDS"] as $field):?>
					<td>
						<?if (array_key_exists($field, $arDecorate)):?>
							<img src="<?=TPL_URL?>/images/elem.jpg" class="table-img" title="Элемент" />
							<?=GetStrTpl($arDecorate[$field], $arItem)?>
						<?else:?>
							<?=$arItem[$field]?>
						<?endif?>
					</td>
				<?endforeach;?>
				<td><a href="?ACTION=EDIT&CATALOG_ID=<?=$arItem["CATALOG_ID"]?>&TYPE=<?=$arItem["CATALOG_TYPE_ID"]?>&ID=<?=$arItem["ID"]?>">Изменить</a> <a href="?ACTION=DELETE&ID=<?=$arItem["ID"]?>">Удалить</a></td>
			</tr>
		<?endforeach?>
<?endif?>
</table>